﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Prices.SerArea.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Check Region</title>
    <script src="assets/js/Admin_002.js" type="text/javascript"></script>
    <script src="assets/js/Admin.js" type="text/javascript"></script>
    <script src="assets/js/Validation.js" type="text/javascript"></script>
    <script src="assets/js/jquery-1.4.2.js" type="text/javascript"></script>
    <%--<script type="text/javascript"
		src="http://code.jquery.com/jquery-1.5.2.min.js"></script>--%>
    <script src="assets/jquery/jquery-ui.min.js" type="text/javascript"></script>
    <script src="assets/jquery/jquery.dialog.extra.js" type="text/javascript"></script>
    <script type='text/javascript' src="assets/js/jquery.bgiframe.min.js"></script>
    <script type='text/javascript' src="assets/js/jquery.ajaxQueue.js"></script>
    <script type='text/javascript' src="assets/js/thickbox-compressed.js"></script>
    <script type='text/javascript' src="assets/js/jquery.autocomplete.js"></script>
    <script type='text/javascript' src="assets/js/Ports.js"></script>
    <script type='text/javascript' src="Assets/js/jquery-custom-1.0.0.js?v=0611"></script>
    <script type='text/javascript' src="Assets/js/zoom.js"></script>
    <script type='text/javascript' src="assets/js/Carrs.js"></script>
    <script type='text/javascript' src="Assets/js/updateprice.js"></script>
    <script type='text/javascript' src="Assets/js/encoder.js"></script>
    <script type='text/javascript' src="Assets/jquery/jquery.cookie.js"></script>
    <link href="assets/jquery/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="assets/css/jquery.autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="assets/css/thickbox.css" />
    <link rel="stylesheet" href="assets/css/reset.css" type="text/css" />
    <link rel="stylesheet" href="assets/css/styleexpress.css" type="text/css" />
    <link rel="stylesheet" href="assets/css/invalid.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="Assets/css/EditTableCell.css" type="text/css" />
    <link rel="stylesheet" href="Assets/css/zoom.css" type="text/css" />
    <script type="text/javascript" language="javascript">
        var nPermissions = '<%=nPermissions %>';
        function getUrlVars() {
            var vars = {};
            var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
                vars[key] = value;
            });
            return vars;
        }
        function doDelete(strID, strName) {
            if (confirm('Bạn có thực sự muốn xóa ' + strID + '?')) {
                var vnpage = getUrlVars()['page_number'];
                if (vnpage)
                    window.location.href = "Prices.aspx?action=delete&ID=" + strID + "&page_number=" + vnpage;
                else
                    window.location.href = "Prices.aspx?action=delete&ID=" + strID;
            }
        }
        function doDeleteGP(strID) {
            if (confirm('Bạn có thực sự muốn xóa ?')) {
                window.location.href = "Prices.aspx?action=deleteGP&GID=" + strID;
            }
        }
        function doDeleteGPNotice(strID) {
            if (confirm('Bạn có thực sự muốn xóa ?')) {
                window.location.href = "Prices.aspx?action=deleteGPN&GNID=" + strID;
            }
        }
        function doPublic(strID, strName) {
            //if (confirm('Bạn có thực sự muốn public ' + strName + '?')) {
            var vnpage = getUrlVars()['page_number'];
            if (vnpage)
                window.location.href = "Prices.SerArea.aspx?action=public&ID=" + strID + "&page_number=" + vnpage;
            else
                window.location.href = "Prices.SerArea.aspx?action=public&ID=" + strID;
            //}
        }
        $().ready(function () {
            $('#txtCarrName').focus().autocomplete(carrs);
            $('#txtPortTo').focus().autocomplete(ports);
            $('#txtPortFrom').focus().autocomplete(ports);
            $('#txtPortToSearch').focus().autocomplete(ports);
            $('#txtPortFromSearch').focus().autocomplete(ports);
            $.getJSON('Handlers/Event.ashx?action=listRegionSchedule', function (data) {
                $('#txtSerArea').focus().autocomplete(data, { matchContains: true });
            });
            $.getJSON('Handlers/Event.ashx?action=listcountry', function (data) {
                $('#txtCountry').focus().autocomplete(data, { matchContains: true });
            });
            txtCountry
        });
        function viewSchedules(POL, POD, CarrID) {
            jQuery.ajax({
                type: "POST",
                url: "AjaxFile/ViewShedulesFromPrice.ashx?POL=" + POL + "&POD=" + POD + "&CarrID=" + CarrID,
                success: function (msg) {
                    var vcontent = "#shedule" + CarrID;
                    $(vcontent).attr("title", msg);
                    //                    $(vcontent).tooltip({
                    //                        track: true,
                    //                        delay: 0,
                    //                        showURL: false,
                    //                        showBody: " - ",
                    //                        fade: 250
                    //                    });
                }
            });

        }
        function doOpenService(POL, POD, CarrID) {
            var url = "Carrier.Services.aspx?POL=" + POL + "&POD=" + POD + "&CarrID=" + CarrID;
            window.open(url, '_blank', 'width=850,height=800,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0', '_blank');
            window.focus();
        }
    </script>
</head>
<body>
    <div id="body-wrapper">
        <div id="header">
            <!--#include virtual="include/top.ascx"-->
        </div>
        <div id="main-content1">
            <%-- <h2>
                TÌM GIÁ</h2>
            <div class="clear">
            </div>--%>
            <div class="content-box">
                <form id="frmPrices" runat="server" autocomplete="off">
                    <div zoomable="true">
                        <div class="content-box-header">
                            <h3 style="cursor: s-resize;">CHECK REGION</h3>
                            <div class="clear">
                            </div>
                        </div>
                        <div>
                            <table class="adminedit" style="width: 900px; float: left;">
                                <tr>
                                    <th align="center">POL
                                    </th>
                                    <th align="center">Ser Region
                                    </th>
                                    <th align="center">Country
                                    </th>
                                    <th align="center">POD
                                    </th>
                                    <th align="center">Time
                                    </th>
                                    <th></th>
                                </tr>
                                <tr>
                                    <td align="left">
                                        <asp:TextBox class="cls" ID="txtPortToSearch" runat="server" Width="200px" TabIndex="16"></asp:TextBox>
                                    </td>
                                    <td align="left">
                                        <asp:TextBox class="cls" ID="txtSerArea" runat="server" Width="150px" TabIndex="16"></asp:TextBox>
                                    </td>
                                    <td align="left">
                                        <asp:TextBox class="cls" ID="txtCountry" runat="server" Width="150px" TabIndex="16"></asp:TextBox>
                                    </td>
                                    <td align="left">
                                        <asp:TextBox class="cls" ID="txtPortFromSearch" runat="server" Width="200px" TabIndex="17"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="drPriceUpdateTime" runat="server" AutoPostBack="true" OnSelectedIndexChanged="drPriceUpdateTime_SelectedIndexChanged">
                                            <asp:ListItem Value="1500" Text="All quotes"></asp:ListItem>
                                            <%--<asp:ListItem Value="0" Text="Any"></asp:ListItem>--%>
                                            <asp:ListItem Value="500" Text="Frm 1st"></asp:ListItem>
                                            <asp:ListItem Value="1000" Text="Frm 15th"></asp:ListItem>
                                            <asp:ListItem Value="1" Text="1 ngày"></asp:ListItem>
                                            <asp:ListItem Value="3" Text="3 ngày"></asp:ListItem>
                                            <asp:ListItem Value="5" Text="5 ngày"></asp:ListItem>
                                            <asp:ListItem Value="10" Text="10 ngày"></asp:ListItem>
                                            <asp:ListItem Value="20" Text="20 ngày"></asp:ListItem>
                                            <asp:ListItem Value="30" Text="30 ngày"></asp:ListItem>
                                            <%-- <asp:ListItem Value="60" Text="60 ngày"></asp:ListItem>
                                        <asp:ListItem Value="90" Text="90 ngày"></asp:ListItem>--%>
                                        </asp:DropDownList>
                                    </td>
                                    <td>
                                        <asp:Button class="button" ID="btnSearch" runat="server" TabIndex="13" Text="Search"
                                            OnClick="btnSearch_Click" />
                                        <%if (Request.QueryString["PortToID"] != null && Request.QueryString["PortFromID"] != null)
                                          { %>
                                        <a class="button" href="Schedules.aspx?PortToID=<%Response.Write(Request.QueryString["PortToID"].ToString());%>&PortFromID=<%Response.Write(Request.QueryString["PortFromID"].ToString());%>&CarrName="
                                            target="_blank" style="display: inline;">View All Schedules</a>
                                        <%} %>
                                        <!--asp:Button class="button" ID="btnAllQuote" TabIndex="13" Text="All quote"
                                    OnClick="btnSearch_Click" CommandName="Allquote" /-->
                                    </td>
                                </tr>
                            </table>
                            <div style="float: right">
                                <table class="adminedit" style="border: none">
                                    <tr>
                                        <td>&nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <input type="button" style="float: right; margin-left: 10px;" class="button" value="Edit"
                                                id="btnsave" runat="server" visible="false" />
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <asp:Label ID="lblerror" CssClass="error" runat="server"></asp:Label><br />
                            <div class="clear">
                            </div>
                        </div>
                        <%=strAlphaBet%>
                        <fieldset>
                            <%--<div style="margin: 10px;">
                            <input type="button" style="float: right; margin-left:10px;" class="button" value="Edit" id="btnsave" runat="server" visible="false" />
                            <asp:Button  ID="btnInit" CssClass="button" style="float:right;"  runat="server" TabIndex="15"
                                Text="Save" OnClick="btnSave_Click" />
                            <div style="float: right" id="selectcolumn">
                            </div>
                            <div style="clear: both;">
                            </div>
                        </div>--%>
                            <asp:Repeater ID="rptData" runat="server">
                                <ItemTemplate>
                                    <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'"
                                        priceid='<%#Eval("ID") %>'>
                                        <td align="center" title="Index" width="28px" style="min-width: 28px; max-width: 28px; overflow: hidden;">
                                            <%# DataBinder.Eval(Container.DataItem, "Index")%>
                                        </td>
                                        <%--<td align="center" width="28px">
                                        <input type="checkbox" class="checkrate" name="cbCheckRate" value='<%#Eval("ID") %>' />
                                    </td>--%>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "PortTo")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "SerArea")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "PortFrom")%>
                                        </td>
                                        <td width="60px" style="min-width: 60px; max-width: 80px; overflow: hidden;">
                                            <b>
                                                <%# DataBinder.Eval(Container.DataItem, "CarrID")%>
                                            </b>
                                        </td>
                                        <td width="60px" editable="true" style="min-width: 60px; max-width: 60px; overflow: hidden;"
                                            code="DC20" title='<%#GetCellTitle(Eval("DC20")) %>' class='<%#GetCellClass(Eval("DC20"))%>'>
                                            <%#GetCellValue(DataBinder.Eval(Container.DataItem, "DC20"))%>
                                        </td>
                                        <td width="60px" editable="true" style="min-width: 60px; max-width: 60px; overflow: hidden;"
                                            code="DC40" title='<%#GetCellTitle(Eval("DC40")) %>' class='<%#GetCellClass(Eval("DC40"))%>'>
                                            <%# GetCellValue(DataBinder.Eval(Container.DataItem, "DC40"))%>
                                        </td>
                                        <td width="60px" editable="true" style="min-width: 60px; max-width: 60px; overflow: hidden;"
                                            code="HC40" title='<%#GetCellTitle(Eval("HC40")) %>' class='<%#GetCellClass(Eval("HC40"))%>'>
                                            <%# GetCellValue(DataBinder.Eval(Container.DataItem, "HC40"))%>
                                        </td>
                                        <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                            code="CONT45" title='<%#GetCellTitle(Eval("CONT45")) %>' class='<%#GetCellClass(Eval("CONT45"))%>'>
                                            <%# GetCellValue(DataBinder.Eval(Container.DataItem, "CONT45"))%>
                                        </td>
                                        <td width="60px" editable="true" style="min-width: 60px; max-width: 60px; overflow: hidden;"
                                            code="RF20" title='<%#GetCellTitle(Eval("RF20")) %>' class='<%#GetCellClass(Eval("RF20"))%>'>
                                            <%#GetCellValue( DataBinder.Eval(Container.DataItem, "RF20"))%>
                                        </td>
                                        <td width="60px" editable="true" style="min-width: 60px; max-width: 60px; overflow: hidden;"
                                            code="RF40" title='<%#GetCellTitle(Eval("RF40")) %>' class='<%#GetCellClass(Eval("RF40"))%>'>
                                            <%# GetCellValue(DataBinder.Eval(Container.DataItem, "RF40"))%>
                                        </td>
                                        <%--<td width="60px" editable="true" style="min-width: 60px; max-width: 60px; overflow: hidden;"
                                        code="TSPort" title='<%#GetCellTitle(Eval("TSPort")) %>' class='<%# Eval("TSPort").ToString()!=""?"has-value":"" %>'>
                                        <%# GetCellValue(DataBinder.Eval(Container.DataItem, "TSPort"))%>
                                    </td>
                                    <td width="60px" editable="true" style="min-width: 60px; max-width: 60px; overflow: hidden;"
                                        code="Sailing" title='<%#GetCellTitle(Eval("Sailing")) %>' class='<%# Eval("Sailing").ToString()!=""?"has-value":"" %>'>
                                        <%# GetCellValue(DataBinder.Eval(Container.DataItem, "Sailing"))%>
                                    </td>
                                    <td width="60px" editable="true" style="min-width: 60px; max-width: 60px; overflow: hidden;"
                                        code="TT" title='<%#GetCellTitle(Eval("TT")) %>' class='<%# Eval("TT").ToString()!=""?"has-value":"" %>'>
                                        <%# GetCellValue(DataBinder.Eval(Container.DataItem, "TT"))%>
                                    </td>--%>
                                        <td width="60px" editable="true" style="min-width: 60px; max-width: 60px; overflow: hidden;"
                                            code="Validity" title='<%#GetCellTitle(Eval("Validity")) %>' class='<%#GetCellClass(Eval("Validity"))%>'>
                                            <%# GetCellValue(DataBinder.Eval(Container.DataItem, "Validity"))%>
                                        </td>
                                        <td width="60px" editable="true" style="min-width: 60px; max-width: 60px;" code="Description"
                                            title='<%#GetCellTitle(Eval("Description")) %>' class='<%#GetCellClass(Eval("Description"))%>'>
                                            <%#GetCellValue( DataBinder.Eval(Container.DataItem, "Description"))%>
                                        </td>
                                        <%--OTFL--%>
                                        <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                            code="OT20" title='<%#GetCellTitle(Eval("OT20")) %>' class='<%#GetCellClass(Eval("OT20"))%>'>
                                            <%# GetCellValue(DataBinder.Eval(Container.DataItem, "OT20"))%>
                                        </td>
                                        <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                            code="OT40" title='<%#GetCellTitle(Eval("OT40")) %>' class='<%#GetCellClass(Eval("OT40"))%>'>
                                            <%# GetCellValue(DataBinder.Eval(Container.DataItem, "OT40"))%>
                                        </td>
                                        <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                            code="FL20" title='<%#GetCellTitle(Eval("FL20")) %>' class='<%#GetCellClass(Eval("FL20"))%>'>
                                            <%# GetCellValue(DataBinder.Eval(Container.DataItem, "FL20"))%>
                                        </td>
                                        <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                            code="FL40" title='<%#GetCellTitle(Eval("FL40")) %>' class='<%#GetCellClass(Eval("FL40"))%>'>
                                            <%# GetCellValue(DataBinder.Eval(Container.DataItem, "FL40"))%>
                                        </td>

                                        <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                            code="ValidityOTFL" title='<%#GetCellTitle(Eval("ValidityOTFL")) %>' class='<%#GetCellClass(Eval("ValidityOTFL"))%>'>
                                            <%# GetCellValue(DataBinder.Eval(Container.DataItem, "ValidityOTFL"))%>
                                        </td>
                                        <td editable="true" style="min-width: 50px; overflow: hidden;" title='<%#GetCellTitle(Eval("DescriptionOTFL")) %>'
                                            code='DescriptionOTFL' class='<%#GetCellClass(Eval("DescriptionOTFL"))%>'>
                                            <%#GetCellValue( DataBinder.Eval(Container.DataItem, "DescriptionOTFL"))%>
                                        </td>
                                        <%--<td width="60px" style="color: #0000ff; min-width: 60px; max-width: 60px; overflow: hidden;"
                                            code="update">
                                            <%#DataBinder.Eval(Container.DataItem, "LastUpdate")%>
                                        </td>--%>
                                        <%if ((Session["prices"] != null) && (int.Parse(Session["prices"].ToString()) >= 3))
                                          {%>
                                        <td align="center">
                                            <%# DataBinder.Eval(Container.DataItem, "Action")%>
                                        </td>
                                        <%} %>
                                        <%--<td style="position: fixed; right: -1000px; margin:0; padding:0; width:0px; display:none;">
                                            &nbsp;
                                        </td>--%>
                                    </tr>
                                </ItemTemplate>
                                <HeaderTemplate>
                                    <div autofit="true" style="">
                                        <table editcellcontent="true" cellspacing="0" cellpadding="0" width="auto" border="0"
                                            class="adminlist" resizeable="true">
                                            <thead>
                                                <tr>
                                                    <!--th rowspan="2" align="center">
                                                STT</th -->
                                                    <th align="center">Index
                                                    </th>
                                                    <th align="center">POL
                                                    </th>
                                                    <th align="center">SER REGION
                                                    </th>
                                                    <th align="center">POD
                                                    </th>
                                                    <%-- <th align="center">
                                                    <input type="checkbox" id="selectAll" />
                                                </th>--%>
                                                    <th align="center" class="resizeable">Carr
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="DC20">DC20
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="DC40">DC40
                                                    </th>
                                                    <th class="resizeable unviewable" code="HC40">HC40
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="CONT45">45'
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="RF20">RF20
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="RF40">RF40
                                                    </th>
                                                    <%--<th align="center" class="resizeable unviewable" code="TSPort">
                                                    TSPort
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="Sailing">
                                                    Sailing
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="TT">
                                                    TT
                                                </th>--%>
                                                    <!--th align="center">
                                                Update</th-->
                                                    <th align="center" class="resizeable unviewable" code="Validity">Validity
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="Description">Note
                                                    </th>
                                                    <!--th align="center">
                                                User</th-->
                                                    <%--<th align="center" code="update">Update
                                                    </th>--%>
                                                    <%--OTFL--%>
                                                    <th class="resizeable unviewable" code="OT20">OT20
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="OT40">OT40
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="FL20">FL20
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="FL40">FL40
                                                    </th>

                                                    <th align="center" class="resizeable unviewable" code="ValidityOTFL">Validity
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="DescriptionOTFL">Note
                                                    </th>
                                                    <%if ((Session["prices"] != null) && (int.Parse(Session["prices"].ToString()) >= 3))
                                                      {%>
                                                    <th align="center" width="100px">Action
                                                    </th>
                                                    <%} %>
                                                    <%--<td style="position: fixed; right: -1000px;">
                                                    &nbsp;
                                                </td>--%>
                                                </tr>
                                            </thead>
                                </HeaderTemplate>
                                <FooterTemplate>
                                    </TABLE> </div>
                                </FooterTemplate>
                            </asp:Repeater>
                        </fieldset>
                        <div class="clear">
                        </div>
                        <div id="footer">
                            <%=strPager%>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <span id="ruler" style="visibility: hiddens; white-space: nowrap"></span>
</body>
</html>
